var cache = new pi.cache("NewCollection");
var get = function(){
	var value,source;
	
	if(cache.has("unixtime")){
		source = "cache";
		value = cache.get("unixtime");
	} else {
		source = "server";
		value = pi.xhr.get("examples/unixtime.php").responseText;
		
		cache.append(
			new pi.cache.item("unixtime").environment.setData(value).environment.setExpirationSliding(10000)
		);
	};
	pi.get("content").innerHTML="<b>Browser time:</b>"+String(Number(new Date)).substring(0,10)
	pi.get("content").innerHTML+="<br /><b>Source:</b> "+source;
	pi.get("content").innerHTML+="<br /><b>Data was got from server:</b>"+value;
	setTimeout(get,1000);
};

get();